<HTML>
<HEAD>
<!-- Created by texi2html 1.56k from /home/jaffer/scheme/r5rs.txi on 28 March 2001 -->

<TITLE>Revised(5) Scheme - 7. Formal syntax and semantics</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="r5rs_1.html">first</A>, <A HREF="r5rs_8.html">previous</A>, <A HREF="r5rs_10.html">next</A>, <A HREF="r5rs_14.html">last</A> section, <A HREF="r5rs_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC71" HREF="r5rs_toc.html#TOC71">7. Formal syntax and semantics</A></H1>

<P>
<A NAME="IDX471"></A>


<P>
This chapter provides formal descriptions of what has already been
described informally in previous chapters of this report.




<H2><A NAME="SEC72" HREF="r5rs_toc.html#TOC72">7.1 Formal syntax</A></H2>

<P>
<A NAME="IDX472"></A>


<P>
This section provides a formal syntax for Scheme written in an extended
BNF.


<P>
All spaces in the grammar are for legibility.  Case is insignificant;
for example, <SAMP>`#x1A'</SAMP> and <SAMP>`#X1a'</SAMP> are equivalent.  &#60;empty&#62;
stands for the empty string.


<P>
The following extensions to BNF are used to make the description more
concise:  &#60;thing&#62;* means zero or more occurrences of
&#60;thing&#62;; and &#60;thing&#62;+ means at least one
&#60;thing&#62;.




<H3><A NAME="SEC73" HREF="r5rs_toc.html#TOC73">7.1.1 Lexical structure</A></H3>

<P>
<A NAME="IDX473"></A>


<P>
This section describes how individual tokens (identifiers,
<A NAME="IDX474"></A>
numbers, etc.) are formed from sequences of characters.  The following
sections describe how expressions and programs are formed from sequences
of tokens.


<P>
&#60;Intertoken space&#62; may occur on either side of any token, but not
within a token.


<P>
Tokens which require implicit termination (identifiers, numbers,
characters, and dot) may be terminated by any &#60;delimiter&#62;, but not
necessarily by anything else.


<P>
The following five characters are reserved for future extensions to the
language: <TT>[ ] { } |</TT>



<PRE>
<TT>&#60;token&#62; --&#62; &#60;identifier&#62; | &#60;boolean&#62; | &#60;number&#62;
<A NAME="IDX475"></A>     | &#60;character&#62; | &#60;string&#62;
     | ( | ) | #( | <TT>'</TT> | <TT>`</TT> | , | ,@ | <B>.</B>
&#60;delimiter&#62; --&#62; &#60;whitespace&#62; | ( | ) | " | ;
&#60;whitespace&#62; --&#62; &#60;space or newline&#62;
&#60;comment&#62; --&#62; ;  &#60;all subsequent characters up to a
                 line break&#62;
<A NAME="IDX476"></A>&#60;atmosphere&#62; --&#62; &#60;whitespace&#62; | &#60;comment&#62;
&#60;intertoken space&#62; --&#62; &#60;atmosphere&#62;*</TT>

</PRE>


<PRE>
<TT>&#60;identifier&#62; --&#62; &#60;initial&#62; &#60;subsequent&#62;*
     | &#60;peculiar identifier&#62;
&#60;initial&#62; --&#62; &#60;letter&#62; | &#60;special initial&#62;
&#60;letter&#62; --&#62; a | b | c | ... | z

&#60;special initial&#62; --&#62; ! | $ | % | &#38; | * | / | : | &#60; | =
     | &#62; | ? | ^ | _ | ~
&#60;subsequent&#62; --&#62; &#60;initial&#62; | &#60;digit&#62;
     | &#60;special subsequent&#62;
&#60;digit&#62; --&#62; 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
&#60;special subsequent&#62; --&#62; + | - | . | @
&#60;peculiar identifier&#62; --&#62; + | - | ...
&#60;syntactic keyword&#62; --&#62; &#60;expression keyword&#62;
<A NAME="IDX477"></A><A NAME="IDX478"></A>     | else | =&#62; | define 
     | unquote | unquote-splicing
&#60;expression keyword&#62; --&#62; quote | lambda | if
     | set! | begin | cond | and | or | case
     | let | let* | letrec | do | delay
     | quasiquote

<SAMP>`&#60;variable&#62; => &#60;'</SAMP>any &#60;identifier&#62; that isn't
<A NAME="IDX479"></A>                also a &#60;syntactic keyword&#62;&#62;

&#60;boolean&#62; --&#62; #t | #f
&#60;character&#62; --&#62; #\ &#60;any character&#62;
     | #\ &#60;character name&#62;
&#60;character name&#62; --&#62; space | newline

&#60;string&#62; --&#62; " &#60;string element&#62;* "
&#60;string element&#62; --&#62; &#60;any character other than " or \&#62;
     | \" | \\ </TT>

</PRE>


<PRE>
<TT>&#60;number&#62; --&#62; &#60;num 2&#62;| &#60;num 8&#62;
     | &#60;num 10&#62;| &#60;num 16&#62;
</TT>

</PRE>

<P>
The following rules for &#60;num R&#62;, &#60;complex R&#62;, &#60;real
R&#62;, &#60;ureal R&#62;, &#60;uinteger R&#62;, and &#60;prefix R&#62;
should be replicated for R = 2, 8, 10,
and 16.  There are no rules for &#60;decimal 2&#62;, &#60;decimal
8&#62;, and &#60;decimal 16&#62;, which means that numbers containing
decimal points or exponents must be in decimal radix.



<PRE>
<TT>&#60;num R&#62; --&#62; &#60;prefix R&#62; &#60;complex R&#62;
&#60;complex R&#62; --&#62; &#60;real R&#62; | &#60;real R&#62; @ &#60;real R&#62;
    | &#60;real R&#62; + &#60;ureal R&#62; i | &#60;real R&#62; - &#60;ureal R&#62; i
    | &#60;real R&#62; + i | &#60;real R&#62; - i
    | + &#60;ureal R&#62; i | - &#60;ureal R&#62; i | + i | - i
&#60;real R&#62; --&#62; &#60;sign&#62; &#60;ureal R&#62;
&#60;ureal R&#62; --&#62; &#60;uinteger R&#62;
    | &#60;uinteger R&#62; / &#60;uinteger R&#62;
    | &#60;decimal R&#62;
&#60;decimal 10&#62; --&#62; &#60;uinteger 10&#62; &#60;suffix&#62;
    | . &#60;digit 10&#62;+ #* &#60;suffix&#62;
    | &#60;digit 10&#62;+ . &#60;digit 10&#62;* #* &#60;suffix&#62;
    | &#60;digit 10&#62;+ #+ . #* &#60;suffix&#62;
&#60;uinteger R&#62; --&#62; &#60;digit R&#62;+ #*
&#60;prefix R&#62; --&#62; &#60;radix R&#62; &#60;exactness&#62;
    | &#60;exactness&#62; &#60;radix R&#62;
</TT>

</PRE>


<PRE>
<TT>&#60;suffix&#62; --&#62; &#60;empty&#62; 
    | &#60;exponent marker&#62; &#60;sign&#62; &#60;digit 10&#62;+
&#60;exponent marker&#62; --&#62; e | s | f | d | l
&#60;sign&#62; --&#62; &#60;empty&#62;  | + |  -
&#60;exactness&#62; --&#62; &#60;empty&#62; | #i | #e
<A NAME="IDX480"></A><A NAME="IDX481"></A>&#60;radix 2&#62; --&#62; #b
<A NAME="IDX482"></A>&#60;radix 8&#62; --&#62; #o
<A NAME="IDX483"></A>&#60;radix 10&#62; --&#62; &#60;empty&#62; | #d
&#60;radix 16&#62; --&#62; #x
<A NAME="IDX484"></A>&#60;digit 2&#62; --&#62; 0 | 1
&#60;digit 8&#62; --&#62; 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
&#60;digit 10&#62; --&#62; &#60;digit&#62;
&#60;digit 16&#62; --&#62; &#60;digit 10&#62; | a | b | c | d | e | f </TT>

</PRE>



<H3><A NAME="SEC74" HREF="r5rs_toc.html#TOC74">7.1.2 External representations</A></H3>

<P>
<A NAME="IDX485"></A>


<P>
&#60;Datum&#62; is what the <CODE>read</CODE> procedure (section see section <A HREF="r5rs_8.html#SEC68">6.6.2 Input</A>)
<A NAME="IDX486"></A>
successfully parses.  Note that any string that parses as an
&#60;expression&#62; will also parse as a &#60;datum&#62;.  



<PRE>
<TT>&#60;datum&#62; --&#62; &#60;simple datum&#62; | &#60;compound datum&#62;
&#60;simple datum&#62; --&#62; &#60;boolean&#62; | &#60;number&#62;
     | &#60;character&#62; | &#60;string&#62; |  &#60;symbol&#62;
&#60;symbol&#62; --&#62; &#60;identifier&#62;
&#60;compound datum&#62; --&#62; &#60;list&#62; | &#60;vector&#62;
&#60;list&#62; --&#62; (&#60;datum&#62;*) | (&#60;datum&#62;+ . &#60;datum&#62;)
       | &#60;abbreviation&#62;
&#60;abbreviation&#62; --&#62; &#60;abbrev prefix&#62; &#60;datum&#62;
&#60;abbrev prefix&#62; --&#62; ' | ` | , | ,@
&#60;vector&#62; --&#62; #(&#60;datum&#62;*) </TT>

</PRE>



<H3><A NAME="SEC75" HREF="r5rs_toc.html#TOC75">7.1.3 Expressions</A></H3>

<P>
<A NAME="IDX487"></A>



<PRE>
<TT>&#60;expression&#62; --&#62; &#60;variable&#62;
     | &#60;literal&#62;
     | &#60;procedure call&#62;
     | &#60;lambda expression&#62;
     | &#60;conditional&#62;
     | &#60;assignment&#62;
     | &#60;derived expression&#62;
     | &#60;macro use&#62;
     | &#60;macro block&#62;

&#60;literal&#62; --&#62; &#60;quotation&#62; | &#60;self-evaluating&#62;
&#60;self-evaluating&#62; --&#62; &#60;boolean&#62; | &#60;number&#62;
     | &#60;character&#62; | &#60;string&#62;
&#60;quotation&#62; --&#62; '&#60;datum&#62; | (quote &#60;datum&#62;)
&#60;procedure call&#62; --&#62; (&#60;operator&#62; &#60;operand&#62;*)
&#60;operator&#62; --&#62; &#60;expression&#62;
&#60;operand&#62; --&#62; &#60;expression&#62;

&#60;lambda expression&#62; --&#62; (lambda &#60;formals&#62; &#60;body&#62;)
&#60;formals&#62; --&#62; (&#60;variable&#62;*) | &#60;variable&#62;
     | (&#60;variable&#62;+ . &#60;variable&#62;)
&#60;body&#62; --&#62; &#60;definition&#62;* &#60;sequence&#62;
&#60;sequence&#62; --&#62; &#60;command&#62;* &#60;expression&#62;
&#60;command&#62; --&#62; &#60;expression&#62;

&#60;conditional&#62; --&#62; (if &#60;test&#62; &#60;consequent&#62; &#60;alternate&#62;)
&#60;test&#62; --&#62; &#60;expression&#62;
&#60;consequent&#62; --&#62; &#60;expression&#62;
&#60;alternate&#62; --&#62; &#60;expression&#62; | &#60;empty&#62;

&#60;assignment&#62; --&#62; (set! &#60;variable&#62; &#60;expression&#62;)

&#60;derived expression&#62; --&#62;
       (cond &#60;cond clause&#62;+)
     | (cond &#60;cond clause&#62;* (else &#60;sequence&#62;))
     | (case &#60;expression&#62;
         &#60;case clause&#62;+)
     | (case &#60;expression&#62;
         &#60;case clause&#62;*
         (else &#60;sequence&#62;))
     | (and &#60;test&#62;*)
     | (or &#60;test&#62;*)
     | (let (&#60;binding spec&#62;*) &#60;body&#62;)
     | (let &#60;variable&#62; (&#60;binding spec&#62;*) &#60;body&#62;)
     | (let* (&#60;binding spec&#62;*) &#60;body&#62;)
     | (letrec (&#60;binding spec&#62;*) &#60;body&#62;)
     | (begin &#60;sequence&#62;)
     | (do (&#60;iteration spec&#62;*)
           (&#60;test&#62; &#60;do result&#62;)
         &#60;command&#62;*)
     | (delay &#60;expression&#62;)
     | &#60;quasiquotation&#62;

&#60;cond clause&#62; --&#62; (&#60;test&#62; &#60;sequence&#62;)
      | (&#60;test&#62;)
      | (&#60;test&#62; =&#62; &#60;recipient&#62;)
&#60;recipient&#62; --&#62; &#60;expression&#62;
&#60;case clause&#62; --&#62; ((&#60;datum&#62;*) &#60;sequence&#62;)
&#60;binding spec&#62; --&#62; (&#60;variable&#62; &#60;expression&#62;)
&#60;iteration spec&#62; --&#62; (&#60;variable&#62; &#60;init&#62; &#60;step&#62;)
    | (&#60;variable&#62; &#60;init&#62;)
&#60;init&#62; --&#62; &#60;expression&#62;
&#60;step&#62; --&#62; &#60;expression&#62;
&#60;do result&#62; --&#62; &#60;sequence&#62; | &#60;empty&#62;

&#60;macro use&#62; --&#62; (&#60;keyword&#62; &#60;datum&#62;*)
&#60;keyword&#62; --&#62; &#60;identifier&#62;

&#60;macro block&#62; --&#62;
     (let-syntax (&#60;syntax spec&#62;*) &#60;body&#62;)
     | (letrec-syntax (&#60;syntax spec&#62;*) &#60;body&#62;)
&#60;syntax spec&#62; --&#62; (&#60;keyword&#62; &#60;transformer spec&#62;)

</TT>

</PRE>



<H3><A NAME="SEC76" HREF="r5rs_toc.html#TOC76">7.1.4 Quasiquotations</A></H3>

<P>
<A NAME="IDX488"></A>


<P>
The following grammar for quasiquote expressions is not context-free.
It is presented as a recipe for generating an infinite number of
production rules.  Imagine a copy of the following rules for D = 1, 2,3, ....  D keeps track of the nesting depth.



<PRE>
<TT>&#60;quasiquotation&#62; --&#62; &#60;quasiquotation 1&#62;
&#60;qq template 0&#62; --&#62; &#60;expression&#62;
&#60;quasiquotation D&#62; --&#62; `&#60;qq template D&#62;
       | (quasiquote &#60;qq template D&#62;)
&#60;qq template D&#62; --&#62; &#60;simple datum&#62;
       | &#60;list qq template D&#62;
       | &#60;vector qq template D&#62;
       | &#60;unquotation D&#62;
&#60;list qq template D&#62; --&#62; (&#60;qq template or splice D&#62;*)
       | (&#60;qq template or splice D&#62;+ . &#60;qq template D&#62;)
       | '&#60;qq template D&#62;
       | &#60;quasiquotation D+1&#62;
&#60;vector qq template D&#62; --&#62; #(&#60;qq template or splice D&#62;*)
&#60;unquotation D&#62; --&#62; ,&#60;qq template D-1&#62;
       | (unquote &#60;qq template D-1&#62;)
&#60;qq template or splice D&#62; --&#62; &#60;qq template D&#62;
       | &#60;splicing unquotation D&#62;
&#60;splicing unquotation D&#62; --&#62; ,@&#60;qq template D-1&#62;
       | (unquote-splicing &#60;qq template D-1&#62;) </TT>

</PRE>

<P>
In &#60;quasiquotation&#62;s, a &#60;list qq template D&#62; can sometimes
be confused with either an &#60;unquotation D&#62; or a &#60;splicing
unquotation D&#62;.  The interpretation as an
&#60;unquotation&#62; or &#60;splicing
unquotation D&#62; takes precedence.




<H3><A NAME="SEC77" HREF="r5rs_toc.html#TOC77">7.1.5 Transformers</A></H3>

<P>
<A NAME="IDX489"></A>



<PRE>
<TT>&#60;transformer spec&#62; --&#62;
    (syntax-rules (&#60;identifier&#62;*) &#60;syntax rule&#62;*)
&#60;syntax rule&#62; --&#62; (&#60;pattern&#62; &#60;template&#62;)
&#60;pattern&#62; --&#62; &#60;pattern identifier&#62;
     | (&#60;pattern&#62;*)
     | (&#60;pattern&#62;+ . &#60;pattern&#62;)
     | (&#60;pattern&#62;* &#60;pattern&#62; &#60;ellipsis&#62;)
     | #(&#60;pattern&#62;*)
     | #(&#60;pattern&#62;* &#60;pattern&#62; &#60;ellipsis&#62;)
     | &#60;pattern datum&#62;
&#60;pattern datum&#62; --&#62; &#60;string&#62;
     | &#60;character&#62;
     | &#60;boolean&#62;
     | &#60;number&#62;
&#60;template&#62; --&#62; &#60;pattern identifier&#62;
     | (&#60;template element&#62;*)
     | (&#60;template element&#62;+ . &#60;template&#62;)
     | #(&#60;template element&#62;*)
     | &#60;template datum&#62;
&#60;template element&#62; --&#62; &#60;template&#62;
     | &#60;template&#62; &#60;ellipsis&#62;
&#60;template datum&#62; --&#62; &#60;pattern datum&#62;
&#60;pattern identifier&#62; --&#62; &#60;any identifier except <SAMP>`...'</SAMP>&#62;
&#60;ellipsis&#62; --&#62; &#60;the identifier <SAMP>`...'</SAMP>&#62;
</TT>

</PRE>



<H3><A NAME="SEC78" HREF="r5rs_toc.html#TOC78">7.1.6 Programs and definitions</A></H3>

<P>
<A NAME="IDX490"></A>



<PRE>
<TT>&#60;program&#62; --&#62; &#60;command or definition&#62;*
&#60;command or definition&#62; --&#62; &#60;command&#62;
    | &#60;definition&#62;
    | &#60;syntax definition&#62;
    | (begin &#60;command or definition&#62;+)
&#60;definition&#62; --&#62; (define &#60;variable&#62; &#60;expression&#62;)
      | (define (&#60;variable&#62; &#60;def formals&#62;) &#60;body&#62;)
      | (begin &#60;definition&#62;*)
&#60;def formals&#62; --&#62; &#60;variable&#62;*
      | &#60;variable&#62;* . &#60;variable&#62;
&#60;syntax definition&#62; --&#62;
     (define-syntax &#60;keyword&#62; &#60;transformer spec&#62;)
</TT>

</PRE>

<P>
       


<H2><A NAME="SEC79" HREF="r5rs_toc.html#TOC79">7.2 Formal semantics</A></H2>

<P>
<A NAME="IDX491"></A>


<P>
This section provides a formal denotational semantics for the primitive
expressions of Scheme and selected built-in procedures.  The concepts
and notation used here are described in [STOY77].



<BLOCKQUOTE>
<P>
<EM>Note:</EM> The formal semantics section was written in LaTeX which
is incompatible with TeXinfo.  See the Formal semantics section: 
<A HREF="http://swissnet.ai.mit.edu/~jaffer/r5rs-formal.pdf">http://swissnet.ai.mit.edu/~jaffer/r5rs-formal.pdf</A>
</BLOCKQUOTE>

<P>
        


<H2><A NAME="SEC80" HREF="r5rs_toc.html#TOC80">7.3 Derived expression types</A></H2>

<P>
<A NAME="IDX492"></A>


<P>
This section gives macro definitions for the derived expression types in
terms of the primitive expression types (literal, variable, call, <SAMP>`lambda'</SAMP>,
<SAMP>`if'</SAMP>, <SAMP>`set!'</SAMP>).  See section <A HREF="r5rs_8.html#SEC64">6.4 Control features</A> for a possible
definition of <SAMP>`delay'</SAMP>.



<PRE>

(define-syntax cond
  (syntax-rules (else =&#62;)
    ((cond (else result1 result2 ...))
     (begin result1 result2 ...))
    ((cond (test =&#62; result))
     (let ((temp test))
       (if temp (result temp))))
    ((cond (test =&#62; result) clause1 clause2 ...)
     (let ((temp test))
       (if temp
           (result temp)
           (cond clause1 clause2 ...))))
    ((cond (test)) test)
    ((cond (test) clause1 clause2 ...)
     (let ((temp test))
       (if temp
           temp
           (cond clause1 clause2 ...))))
    ((cond (test result1 result2 ...))
     (if test (begin result1 result2 ...)))
    ((cond (test result1 result2 ...)
           clause1 clause2 ...)
     (if test
         (begin result1 result2 ...)
         (cond clause1 clause2 ...)))))

</PRE>


<PRE>

(define-syntax case
  (syntax-rules (else)
    ((case (key ...)
       clauses ...)
     (let ((atom-key (key ...)))
       (case atom-key clauses ...)))
    ((case key
       (else result1 result2 ...))
     (begin result1 result2 ...))
    ((case key
       ((atoms ...) result1 result2 ...))
     (if (memv key '(atoms ...))
         (begin result1 result2 ...)))
    ((case key
       ((atoms ...) result1 result2 ...)
       clause clauses ...)
     (if (memv key '(atoms ...))
         (begin result1 result2 ...)
         (case key clause clauses ...)))))

</PRE>


<PRE>

(define-syntax and
  (syntax-rules ()
    ((and) #t)
    ((and test) test)
    ((and test1 test2 ...)
     (if test1 (and test2 ...) #f))))

</PRE>


<PRE>

(define-syntax or
  (syntax-rules ()
    ((or) #f)
    ((or test) test)
    ((or test1 test2 ...)
     (let ((x test1))
       (if x x (or test2 ...))))))

</PRE>


<PRE>

(define-syntax let
  (syntax-rules ()
    ((let ((name val) ...) body1 body2 ...)
     ((lambda (name ...) body1 body2 ...)
      val ...))
    ((let tag ((name val) ...) body1 body2 ...)
     ((letrec ((tag (lambda (name ...)
                      body1 body2 ...)))
        tag)
      val ...))))

</PRE>


<PRE>

(define-syntax let*
  (syntax-rules ()
    ((let* () body1 body2 ...)
     (let () body1 body2 ...))
    ((let* ((name1 val1) (name2 val2) ...)
       body1 body2 ...)
     (let ((name1 val1))
       (let* ((name2 val2) ...)
         body1 body2 ...)))))

</PRE>

<P>
The following <SAMP>`letrec'</SAMP> macro uses the symbol <SAMP>`&#60;undefined&#62;'</SAMP>
in place of an expression which returns something that when stored in
a location makes it an error to try to obtain the value stored in the
location (no such expression is defined in Scheme).
A trick is used to generate the temporary names needed to avoid
specifying the order in which the values are evaluated.
This could also be accomplished by using an auxiliary macro.



<PRE>

(define-syntax letrec
  (syntax-rules ()
    ((letrec ((var1 init1) ...) body ...)
     (letrec "generate temp names"
       (var1 ...)
       ()
       ((var1 init1) ...)
       body ...))
    ((letrec "generate temp names"
       ()
       (temp1 ...)
       ((var1 init1) ...)
       body ...)
     (let ((var1 &#60;undefined&#62;) ...)
       (let ((temp1 init1) ...)
         (set! var1 temp1)
         ...
         body ...)))
    ((letrec "generate temp names"
       (x y ...)
       (temp ...)
       ((var1 init1) ...)
       body ...)
     (letrec "generate temp names"
       (y ...)
       (newtemp temp ...)
       ((var1 init1) ...)
       body ...))))

</PRE>


<PRE>

(define-syntax begin
  (syntax-rules ()
    ((begin exp ...)
     ((lambda () exp ...)))))

</PRE>

<P>
The following alternative expansion for <SAMP>`begin'</SAMP> does not make use of
the ability to write more than one expression in the body of a lambda
expression.  In any case, note that these rules apply only if the body
of the <SAMP>`begin'</SAMP> contains no definitions.



<PRE>

(define-syntax begin
  (syntax-rules ()
    ((begin exp)
     exp)
    ((begin exp1 exp2 ...)
     (let ((x exp1))
       (begin exp2 ...)))))

</PRE>

<P>
The following definition
of <SAMP>`do'</SAMP> uses a trick to expand the variable clauses.
As with <SAMP>`letrec'</SAMP> above, an auxiliary macro would also work.
The expression <SAMP>`(if #f #f)'</SAMP> is used to obtain an unspecific
value.



<PRE>

(define-syntax do
  (syntax-rules ()
    ((do ((var init step ...) ...)
         (test expr ...)
         command ...)
     (letrec
       ((loop
         (lambda (var ...)
           (if test
               (begin
                 (if #f #f)
                 expr ...)
               (begin
                 command
                 ...
                 (loop (do "step" var step ...)
                       ...))))))
       (loop init ...)))
    ((do "step" x)
     x)
    ((do "step" x y)
     y)))

</PRE>

<P>
         


<P><HR><P>
Go to the <A HREF="r5rs_1.html">first</A>, <A HREF="r5rs_8.html">previous</A>, <A HREF="r5rs_10.html">next</A>, <A HREF="r5rs_14.html">last</A> section, <A HREF="r5rs_toc.html">table of contents</A>.

&nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp;

</BODY>
</HTML>
